package com.itheima.response;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/demo04")
public class ResponseDemo04Servlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          //地址栏访问 通过get请求进行处理
        System.out.println("请求来了，我response对象设置响应头信息");
        //正常情况下 都是服务器自动产生响应头信息 我们也可以手动设置一些信息
        //给浏览器
        response.setHeader("xiaojiejie","小阿四");
        response.setHeader("xiaogege","小硕硕");


    }
}
